<template>
	<view class="parent-view">
		<view class="card-info-view">
			<view class="top-info">
				<view class="head-view">
					<image class="head-image" :src="xiupushiData.avatar"></image>
					<text class="name-txt">{{xiupushiData.uname}}</text>
				</view>
				<view class="jpg-info-view">
					<view class="jpg-name-view">
						<text class="jpg-name">{{xiupushiData.name}}</text>
					</view>
					<text class="jpg-address">{{xiupushiData.ance}}</text>
					<text class="jpg-time">加入时间：{{xiupushiData.addtime}}</text>
				</view>
			</view>
			<view class="yye-txt-view">
				<text class="yye-txt">营业额：{{xiupushiData.price}}</text>
			</view>
		</view>
		<scroll-view class="sv-view" scroll-y="true" :show-scrollbar="false" @scrolltolower="onreachBottom">
			<view class="swiper-item-view">
				<!-- 营业额明细 -->
				<view class="yye-view" v-for="(item , index) in mingxiList" :key="index">
					<view class="yye-name-view">
						<text class="yye-name-txt">{{item.uname}} {{item.umobile}}</text>
						<text class="yye-price">+{{item.price}}</text>
					</view>
					<text class="yye-jiapu-name">{{item.treename}} ({{item.treecode}})</text>
					<text class="yye-order-num">订单编号：{{item.ordersn}}</text>
					<text class="yye-order-time">付款时间：{{item.pay_time}}</text>
					<text class="yye-order-beizhu">订单备注：{{item.bio}}</text>
				</view>
				<view style="width: 100%;height: 30rpx;"></view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	import request from '../../pages/index/request.js';
	export default {
		data() {
			return {
				xiupushiData:{},
				userPQD:"",
				page:1,
				mingxiList:[],
			}
		},
		methods: {
			onLoad: function(options) {
				this.userPQD=options.userPQD
				this.getXPSInfo()
				this.getXpsEarningsList()
			},
			onShow: function() {
				this.share.url = '../../pages/tabBar/home/index?appInviteId=' + this.appUtil.getAppInviteId()
				this.share.shareType = 1
			},
			getXPSInfo: function() {
				var that = this
				request.post("api/common/GetXPSInfo", {
					PQD:this.userPQD
				}).then(data => {
					that.xiupushiData=data
				})
			},
			/** scroll-view到底部加载更多 */
			onreachBottom: function() {
				this.page=this.page+1
				this.getXpsEarningsList()
			},
			getXpsEarningsList: function() {
				var that = this
				request.post("api/common/GetXpsEarningsList", {
					PQD:this.userPQD,
					page:this.page
				}).then(data => {
					if(that.page==1){
						that.mingxiList=data
					}else{
						for (var i = 0; i < data.length; i++) {
							that.mingxiList.push(data[i])
						}
					}
				})
			},
		}
	}
</script>

<style>
	@import "index.css";
</style>
